#pragma once
#include <string>
#include <map>
#include "Types.h"
#include <ctime>

namespace ks3::sdk {

class GeneratePresignedUrlRequest {
public:
    GeneratePresignedUrlRequest(std::string bucket, std::string key);
    GeneratePresignedUrlRequest(std::string bucket, std::string key, MethodType method);
    void SetBucket(const std::string& bucket);
    const std::string& GetBucket() const;
    void SetKey(const std::string& key);
    const std::string& GetKey() const;
    void SetMethod(MethodType method);
    MethodType GetMethod() const;
    void SetExpires(int64_t expires);
    const std::string& GetExpires() const;
    void SetParameters(const std::map<std::string, std::string>& parameters);
    const std::map<std::string, std::string>& GetParameters() const;
    void SetHeaders(const std::map<std::string, std::string>& headers);
    const std::map<std::string, std::string>& GetHeaders() const;
private:
    friend class KS3Client;
    std::string bucket_;
    std::string key_;
    MethodType method_;
    // 默认15分钟过期
    std::string expires_ = std::to_string(std::time(nullptr) + 15 * 60);
    std::map<std::string, std::string> parameters_;
    std::map<std::string, std::string> headers_;
};

}